/**
 * Created by Administrator on 2017/3/4.
 */
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { Jsonp, URLSearchParams,Response } from '@angular/http';
import { Observable }   from 'rxjs/observable';
import 'rxjs/add/operator/catch';

@Injectable()
export class DonathreeService {
  constructor(private jsonp: Jsonp) {}
  public statu='';
  private showfrom:boolean;
  cardinfro (type:string) {
    let wikiUrl = 'http://api.pinwu.net/pay/onlinepay';
    let params = new URLSearchParams();
    params.set('type', type);
    params.set('callback', 'JSONP_CALLBACK');
    return this.jsonp
      .get(wikiUrl, { search: params })
      .map((res:Response)=>{
        let result=res.json();
        console.log(result);
        return result;
      });
  }
}
